/*******************************************************************************
 * Copyright (c) 2014 Greg Marut.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v3.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/gpl.html
 * 
 * Contributors:
 *    Greg Marut - initial API and implementation
 ******************************************************************************/
package com.gregmarut.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * @author Greg Marut Responsible for loading a properties file and returning a
 * Properties object containing the information from this file
 */
public class PropertiesLoader
{
	/**
	 * loads the properties for this client
	 * 
	 * @param strFile
	 * @param objClass
	 * @return
	 * @throws IOException
	 */
	public static Properties load(String strFile, Class<?> objClass)
		throws IOException
	{
		// create the properties object
		Properties objConfigProperties = new Properties();
		
		// create the input stream object
		InputStream objInputStream = objClass.getResourceAsStream(strFile);
		
		// load the config file
		objConfigProperties.load(objInputStream);
		
		// close the input stream
		objInputStream.close();
		
		// return the properties object
		return objConfigProperties;
	}
}
